<?php $errorMsg='';if(!filter_has_var(INPUT_POST,'ids')||!filter_has_var(INPUT_POST,'new_status')||($_POST['new_status']!=='released'and$_POST['new_status']!=='unreleased')){$errorMsg="参数错误";}if(!$errorMsg){$articleObj=(new Zmsun\Copen\TopPackage("zm345.open.enterpr",new Zmsun\Copen\OpenLib($this->serviceManager->get("Database"),$this->serviceManager->get("DBTablePrefix"))))->article;$articleUpdate=$articleObj->articlesUpdate->setRefIds($_POST['ids'])->setStatus($_POST['new_status']);if($_POST['new_status']=='released'){$articleUpdate->setReleaseDatetime("");}$errorMsg=$articleUpdate->exec();if($errorMsg['status']=='error'){$errorMsg=$errorMsg['error_msg'];}else{$errorMsg="";}}echo json_encode(['status'=>$errorMsg ?'error':'ok','info'=>$errorMsg]);?>